package com.project.auth.controller.process;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.auth.service.ProcessService;
import com.project.auth.vo.process.ProcessQueryVo;
import com.project.auth.vo.process.ProcessVo;
import com.project.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author : XIAOMING
 * @create 2023/6/1 10:46
 */
@RestController
@RequestMapping("/admin/process")
public class ProcessController {
    @Autowired
    private ProcessService processService;

    @ApiOperation(value = "获取分页列表")
    @GetMapping("{page}/{limit}")
    public Result index(@PathVariable Long page, @PathVariable Long limit, ProcessQueryVo processQuery) {
        Page<ProcessVo> pageParam = new Page<>(page, limit);
        IPage<ProcessVo> pageList = processService.selectPage(pageParam, processQuery);

        return Result.ok(pageList);
    }


}
